#pragma once
#include "IMediaUdpSender.h"
#include "IMediaUdpRecver.h"
#include "IUdpClient.h"
#include "ISocketInterface.h"

class CUdpClient : public IMediaUdpSender, public IMediaUdpRecver, public IUdpClient
{
public:
    CUdpClient(ILiveEvent* event_, USER_ID uid_, ROOM_ID room_id_);
    virtual ~CUdpClient(void);

    void                init_send_packet_timer();
    void                init_recv_packet_timer();
    int32_t             send_media(NetPacket* pkt_);

    void                on_login_result(int32_t result_, uint32_t first_pkt_seq_ = 0);
    void                on_logout_result(int32_t result_);
    void                on_offline();
    
protected:
    int32_t             process_msg(NetPacket& pkt_);

    int32_t             send_media_direct(NetPacket* pkt_);
    void                send_report_pkt(NetPacket& pkt_);
    
protected:
    ILiveEvent*         _session_event;
};
